{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}


<div class="container-fluid content-body">
	<div class="main">
		<!-- left side start-->
		{include admin.inc.menu}
		<!-- left side end-->


		<!-- main content start-->
		<section class="right-section" id="right-section">
			<!-- start of inner-frame -->
			<div class="inner-iframe">

				<!-- page breadcrumb start-->
				{include admin.inc.bread}
				<!-- page "breadcrumb end-->
				<!-- Nav tabs -->
				<ul class="nav nav-tabs">

				   <ul class="nav nav-tabs">

						<li><a href="add" ><i class="glyphicon glyphicon-plus"></i> 添加站内信</a></li>
					   <li><a href="index" ><i class="glyphicon glyphicon-th-list"></i> 站内信列表</a></li>

					   <!--<li><a href="ruleAdd" ><i class="glyphicon glyphicon-plus"></i> 添加规则</a></li>-->
						<li><a href="ruleIndex" ><i class="glyphicon glyphicon-th-list"></i> 规则列表</a></li>
						<li><a href="tmplAdd" ><i class="glyphicon glyphicon-plus"></i> 添加模板</a></li>
					   <li {if $id==''}class="active"{/if}><a {if $id==''}href="javascript:void(0);"{else}href="{$index_url}"{/if}><i class="glyphicon glyphicon-th-list"></i> 模板列表</a></li>

					</ul>
				</ul>
				<div class="inner-container">
					<form class="form-inline search-form" role="form">
						<div class="form-group">
							<select name="select_mix_option1" class="form-control input-sm" data-value="{$search_arr[select_mix_option1]}">
								<option value="tmpl_name">模板名称</option>
							</select>
						</div>
						<!-- searchinput -->
						<div class="form-group">
							<div class="input-group">

								<input type="text" class="form-control input-sm" maxlength="{maxlength}" placeholder="关键词" name="select_mix_option_value1" value="{$search_arr[select_mix_option_value1]}">
							</div>
						</div>

						<div class="form-group">
							<select name="select_mix_option2" id="select-mix-option2" class="form-control input-sm">
								<option value="addtime">添加时间</option>
							</select>
						</div>
						<!-- searchdatetime -->
						<div class="form-group">
							<div class="input-group">

								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
									   name="start_time" value="{$search_arr[start_time]}"
									   placeholder="开始时间" />

								<div class="input-group-addon">
									-
								</div>
								<input style="width:100px;" class="form-control form-control-inline input-sm mdate"  size="16" type="text"
									   name="end_time" value="{$search_arr[end_time]}"
									   placeholder="结束时间" />
							</div>
						</div>


						<div class="form-group">
							<select name="status" class="form-control input-sm " data-value="{$search_arr[status]}">
								<option value="all">-状态-</option>
								<option value="1">启用</option>
								<option value="0">禁用</option>
							</select>
						</div>

						<div class="input-group">
							<div class="input-group-addon">
								添加人
							</div>
							<input type="text" class="form-control input-sm" maxlength="20" placeholder="添加人"
								   name="manager_name" value="{$search_arr['manager_name']}">
						</div>


						<input type="hidden" name="order" value="{$order}">
						<button type="submit" class="btn btn-sm btn-success">搜索</button>
					</form>
					<form id="J_List_Form">
						<div class="table-responsive">
							<table id="J_ListTable" class="table  table-hover  table-striped">
								<!--tmpl-listtable-->

								<!-- listblock -->
								<thead>
									<tr>
										<th width="20"><input type="checkbox" class="icheck check-all" /></th>
										<!--tmpl-fieldheaders-->
								
										<th>模板名称</th>
										<th>状态</th>
										<th>添加时间</th>
										<th>添加人</th>

										<th>操作</th>
									</tr>
								</thead>
								<tbody>
								{if empty($items)}
								<tr>
									<td style="text-align:center;" colspan="5" class="empty-table-td">{$emptyRecord}</td>
								</tr>
								{/if}
								{loop $items $value}
								<tr>
									<td><input type="checkbox" class="icheck" name="ids[]" value="{$value[id]}"/></td>
									<!--tmpl-fieldlist-->
								
									<td>{$value[name]}</td>
									<td>

										{if $value[status]=='启用'}

										<input data-id="{$value[id]}"  type='checkbox' data-on-text='启用' data-off-text='禁用' class='bswitch js-status' data-size='mini' checked >

										{else}
										<input data-id="{$value[id]}"  type='checkbox' data-on-text='启用' data-off-text='禁用' class='bswitch js-status' data-size='mini'  >

										{/if}
									</td>
									<td>{$value[addtime]}</td>
									<td>{$value[manager_name]}</td>
									<td>
										{if in_case_array('admin/remind/edittmpl',$priv) || empty($priv)}

										<a href="editTmpl?id={$value[id]}" class="btn btn-primary btn-xs">
											<i class="glyphicon glyphicon-edit"></i> 编辑</a>
										{/if}

									</td>
								</tr>
								{/loop}
								

							</table>

						</div>
						
					</form>
					<div class="text-right" style="float: right">
						{$pagemenu}
					</div>

				</div>
			</div>
		</section>
	</div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->

<!--tmpl-script-->

<!-- template -->
<script id="editpanel" type="text/html">
	<div>
		<form id="editpanel-form" class="form-horizontal">
			<div class="row">&nbsp</div>
			<!--tmpl-fieldlist-->

			<!-- select -->
			<div class="form-group">
				<label>接收用户</label>
				<select class="form-control m-bot15 select2" id="inputto_member_id" name="data[to_member_id]">
					<option value="0">-- 请选择 --</option>
					<!--tmpl-options-->
			
					<!-- selectoptions -->
					{loop $to_member_idoptions $v}
					<option {if $item[to_member_id] == $v[id]}selected{/if} value="{$v[id]}">{$v[id]}</option>
					{/loop}
					
			
				</select>
			</div>
			<p class="help-block"></p>
			
			<!-- input -->
			<div class="form-group">
				<label >信息内容 </label>
				<input  dtype="" class="form-control" maxlength="255" name="data[message_content]" placeholder="信息内容" required cname="信息内容" value="{[message_content]}" />
			</div>
			<p class="help-block"></p>
			
			<!-- switch -->
			<div class="form-group">
				<label>是否已读</label>
				<div>
					<input type="checkbox" id="switch-is_read" name="data[is_read]" class="bswitch" data-size="normal" {if $item[is_read]}checked{/if} data-on-text="已读" data-off-text="未读">
				</div>
			</div>
			

			<!--tmpl-assocfields-->
		</form>
	</div>
</script>

<!-- pagescript -->
<script type="text/javascript">
	seajs.use("admin/message_remindindex",function (parameter){
		
		/**--tmpl-templatejavascript--**/
		
		<!--tmpl-templatejavascript-->
		parameter.detailUrl="{$detail_url}";
		parameter.deleteUrl="{$delete_url}";
		parameter.editUrl="{$do_edit_url}";
		parameter.upload_url="{$upload_url}";
		parameter.image_search_url="{$image_search_url}";
		parameter.image_list_url="{$image_list_url}";
		
		parameter.init();		
	});
</script>


<script id="assocpage" type="text/html">
<div class="text-right">
	<ul class="pagination blog-pagination">
		<li><a class="assoc-page" data-page="{[prev]}" href="javascript:void(0);">上一页</a></li> 
		{[loop pages page]}

		<li {[if curr == page]}class="active"{[/if]}><a class="assoc-page" data-page="{[page]}"  href="javascript:void(0)">{[page]}</a></li> 

		{[/loop]}
		<li><a class="assoc-page" href="javascript:void(0);" data-page="{[nexts]}">下一页</a></li> 
	</ul>	
</div>
</script>
</body>
</html>
